# _*_ coding:utf-8 _*_
import os, django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "performsTest.settings")

django.setup()

from faker import Faker
from  bookshop.models import *
import  random
fake = Faker()
def create_library():
    for _ in range(1000):
        Library(name=fake.name(),address=fake.address()).save()

def create_author():
    for _ in range(1000):
        Author(name=fake.name()).save()

def create_book():
    for _ in range(10000):
        Book(title=fake.name(),address=fake.address(),library_id=random.randint(1,1000),author_id=random.randint(1,1000)).save()

def create_pages():
    for _ in range(100000):
        Page(text=fake.text(),page_number=random.randint(1,1000),book_id=random.randint(1,10000)).save()0
if __name__ == '__main__':
	create_library()
	create_author()
	create_book()
    create_pages()




